// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue"
import App from "./App"
import router from "./router"
import "./init/init.css"
import ElementUI from "element-ui"
import "element-ui/lib/theme-chalk/index.css"
import axios from "axios" // 引入 axios
import "./iconFont/iconfont.css" // 引入字体图标
import VueAwesomeSwiper from "vue-awesome-swiper"
import "swiper/dist/css/swiper.css"
import store from "./store" // vuex 的引 入
import animate from "animate.css"
// import './element-variables/element-variables.scss'   // 改变主题色的scss
import headerAd from "@/pages/globalComponents/AdvertisingColumn" // 广告
import navLogin from "@/pages/globalComponents/NavLogin" // 登陆导航
import homeSeach from "@/pages/globalComponents/Seach" // 首页 logo 以及搜索区域
import goodsNav from "@/pages/globalComponents/GoodsNav" // 首页上面的 商品导航
import bottomNav from "@/pages/globalComponents/Bottom" // 底部 会员介绍区域
import homeFooter from "@/pages/globalComponents/Footer" // 底部 公共区域
import noData from "@/pages/globalComponents/noData" // 底部 公共区域
import Lazyload from "vue-lazyload-img"
import imgbase64 from "./imgBase64"
import Print from '@/plugs/print' // 打印


Vue.prototype.imgbase64 = imgbase64
Vue.component("header-ad", headerAd)
Vue.component("nav-login", navLogin)
Vue.component("home-seach", homeSeach)
Vue.component("goods-nav", goodsNav)
Vue.component("bottom-nav", bottomNav)
Vue.component("home-footer", homeFooter)
Vue.component("no-data", noData)
Vue.use(ElementUI)
Vue.use(VueAwesomeSwiper)
Vue.use(animate)
Vue.use(Lazyload, {})
Vue.use(Print)

Vue.config.productionTip = false
    // axios.interceptors.request.use((request) => {
    //   console.log(request);
    //   if (request.method == 'post') {
    //     request.params = {};
    //   }
    //   return request;
    // });
Vue.prototype.$http = axios // axios改写为Vue的原型属性   使用时 直接用 this.$http直接调用
const _hmt = _hmt || [];

window._hmt = _hmt; // 必须把_hmt挂载到window下，否则找不到
(function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?0e6d455407815271e974e3f0718b7e11";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
/* eslint-disable no-new */
new Vue({
    el: "#app",
    router,
    store, // vuex
    components: { App },
    template: "<App/>"
})